<template>
  <el-container>
    <el-aside :width="isCollapse ? '60px' : '230px'">
      <side-bar :width="isCollapse ? '60px' : '230px'"></side-bar>
    </el-aside>
    <el-container>
      <el-header>
        <nav-bar :key="$route.path + 1"></nav-bar>
      </el-header>
      <el-main>
        <nav-list class="navList" :key="$route.path + 1"></nav-list>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import NavBar from "../components/navBar.vue";
import NavList from "../components/navList.vue";
import SideBar from "../components/sideBar.vue";
import { mapState } from "vuex";
export default {
  name: "Home",
  components: {
    SideBar,
    NavBar,
    NavList,
  },
  computed: {
    ...mapState(["isCollapse"]),
  },
};
</script>

<style lang="scss" scoped>
.el-container {
  height: 100%;
}

.el-header,
.el-footer {
  height: 50px !important;
  line-height: 50px;
}

.el-aside {
  line-height: 200px;
  height: 100%;
  background-color: #8a8d8f;
}

.el-main {
  background-color: #f5f4f4;
  height: 100%;
}
.navList {
  margin: -20px -20px 0 -20px;
}
</style>
